import { S } from '../../s';
import { IPSSysCounter } from './ipssys-counter';
import { IPSSysPFPlugin } from '../../res/ipssys-pfplugin';
import { PSModelObjectImpl } from '../../psmodel-object-impl';

export class PSSysCounterImpl
  extends PSModelObjectImpl
  implements IPSSysCounter
{
  get codeName(): string {
    return this.M.codeName;
  }

  get counterData(): string {
    return this.M.counterData;
  }

  get counterData2(): string {
    return this.M.counterData2;
  }

  get counterType(): string {
    return this.M.counterType;
  }

  get customCond(): string {
    return this.M.customCond;
  }

  getPSCounterId(): string {
    return this.M.getPSCounterId;
  }

  protected pssyspfplugin: IPSSysPFPlugin;
  getPSSysPFPlugin(): IPSSysPFPlugin | null {
    return (
      this.pssyspfplugin ||
      (this.pssyspfplugin = this.fillObjectModel(
        S._27c,
        this.M.getPSSysPFPlugin,
        S._2a7,
      ) as IPSSysPFPlugin)
    );
  }

  get timer(): number {
    return this.M.timer != null ? this.M.timer : 0;
  }
  get cls(): string {
    return 'PSSysCounterImpl';
  }
  instanceof(cls: string): boolean {
    if (cls == S._b) return true;
    return super.instanceof(cls);
  }
}
